<?php
// nav active links
$homeCl = "";
$listingCl = "";
$listingAddCl = "";
$offerCl = "";
$eventCl = "";
$userCl = "";
$advSearchCl = "";
$url = $this->params['url']['url'];
if($url == "/")
{
    $homeCl = "active";    
}
if($url == "listings")
{
    $listingCl = "active";    
}
if($url == "listings/add")
{
    $listingAddCl = "active";    
}
if($url == "deals/deals/index/")
{
    $offerCl = "active";    
}
if($url == "events/events/index")
{
    $eventCl = "active";    
}
if($url == "users")
{
    $userCl = "active";    
}
if($url == "listings/advancedSearch")
{
    $advSearchCl = "active";    
}
if($url == "users/register")
{
    $regCl = "active";    
}
if($url == "users/profile")
{
    $regCl = "active";    
}
if($url == "reviews")
{
    $reviewsCl = "active";    
}
?>

<div class="nav_wrap">
		<ul class="nav">
			<li class="<?php echo $homeCl; ?>">
				<?php echo $html->link(__('Home'),'/');?>
			</li>
				
			<li class="<?php echo $listingCl; ?>">
				<?php echo $html->link(__('Listings'),'/listings');?>
			</li> 
			
			<!--<li class="<?php echo $reviewsCl; ?>">
				<?php echo $html->link(__('Reviews'),'/reviews');?>
			</li>-->
				<?php
					if($session->read("Auth.User.id") && (cr('ListingConfig.listing_add_only_by_editor') != 1 || $session->read('Auth.User.is_editor') == 1)) 
					{?><li class="<?php echo $listingAddCl; ?>"><?php
							echo $html->link(__('Add Listing'),'/listings/add');?>	</li><?php
					}
				?>
			<li class="<?php echo $userCl; ?>">
				<?php echo $html->link(__('Users'),'/users');?>
			</li>
		
			<!--<?php if(@$session->read('Auth.User'))
			{?>
			<li class="<?php echo $profileCl; ?>">
				<?php echo $html->link(__('My Account'),'/users/profile');?>
			</li>
			<?php }else{?>
			<li class="<?php echo $regCl; ?>">
				<?php echo $html->link(__('Register'),'/users/register');?>
			</li>
			<?php }?>-->
			<li class="<?php echo $advSearchCl; ?>">
				<?php echo $html->link(__('Search'),'/listings/advancedSearch');?>
			</li>
			<?php if(cr("DealConfig.enable_deals")) { ?>
					<li class="<?php echo $offerCl; ?>">
						<?php echo $html->link(__('Deals'),'/deals/deals/index/');?>
					</li>
				<?php } ?>
			<?php if(cr("EventConfig.enable_events")) { ?>
				<li class="<?php echo $eventCl; ?>">
					<?php echo $html->link(__('Events'),'/events/events/index');?>
				</li>
			<?php } ?>
		</ul>
	</div>
